package com.echoplots.autoconfiguration.bootstrap;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

//模式注解使用@ComponentScan("com.echoplots.autoconfiguration.service")
//注解驱动 @EnableHelloWorld
@EnableAutoConfiguration
public class EchoplotsSpringBootAutoConfigurationApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(EchoplotsSpringBootAutoConfigurationApplication.class)
                .web(WebApplicationType.NONE)
                .run(args);
/*        TestService testService = context.getBean("testService", TestService.class);
        System.out.println("TestService Bean: " + testService);*/
        String hello = context.getBean("hello", String.class);
        System.out.println("hello Bean: " + hello);
        context.close();
    }

}
